<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="/js/spritejs.js"></script>
  <style>
    #container {
      position: absolute;
      width: 1200px;
      height: 600px;
    }
  </style>
</head>
<body>
  <div id="container"></div>
  <script>
    const container = document.getElementById('container');
    const scene = new spritejs.Scene({
      container,
      displayRatio: 2,
      width: 1200,
      height: 600,
      mode: 'stickyHeight',
      // contextType: '2d',
    });

    const svgURL = 'https://s1.ssl.qhres.com/static/9bd74da7f533f462.svg';


    const fglayer = scene.layer('fglayer');
    const root = new spritejs.SpriteSvg(svgURL);
    root.attr({
      x: 100,
      y: 100,
      flexible: true,
      passEvents: true,
      // size: [828, 130],
      scale: 0.5,
    });
    // root.svg.setAttribute('transform-origin', 'top left');
    // root.svg.setAttribute('transform', 'scale(2)');
    fglayer.append(root);

    root.svg.addEventListener('click', (evt) => {
      console.log(evt);
    });
  </script>
</body>
</html>